package com.lagou.search.entity.es;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yzh
 * @since 2021/12/2
 **/
@ApiModel(value = "ES订单")
@Data
@Document(indexName = "order")
public class EsOrder implements Serializable {

    @ApiModelProperty("主键")
    @Field(type = FieldType.Keyword)
    private Long id;

    @ApiModelProperty(value = "订单号", position = 1)
    @Field(type = FieldType.Keyword)
    private String orderNo;

    @ApiModelProperty(value = "用户ID",position = 2)
    @Field(type = FieldType.Keyword)
    private Long userId;

    @ApiModelProperty(value = "用户昵称", position = 3)
    @Field(type = FieldType.Keyword)
    private String userName;

    @ApiModelProperty(value = "收货地址",position = 4)
    @Field(type = FieldType.Keyword)
    private String recvAddress;

    @ApiModelProperty(value = "购买商品总数", position = 5)
    @Field(type = FieldType.Keyword)
    private Integer goodsCount;

    @ApiModelProperty(value = "购买商品总金额", position = 6)
    @Field(type = FieldType.Keyword)
    private BigDecimal priceAmount;

    @ApiModelProperty(value = "运费金额", position = 7)
    @Field(type = FieldType.Keyword)
    private BigDecimal freightAmount;

    @ApiModelProperty(value = "平台补贴总金额", position = 8)
    @Field(type = FieldType.Keyword)
    private BigDecimal totalPreferentialAmount;

    @ApiModelProperty(value = "是否货到付款[0:在线付款 1:货到付款]", position = 9)
    @Field(type = FieldType.Keyword)
    private Integer payOnDelivery;

    @ApiModelProperty(value = "订单状态", position = 10)
    @Field(type = FieldType.Keyword)
    private Integer status;

    @ApiModelProperty(value = "支付时间", position = 11)
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @ApiModelProperty(value = "创建人", position = 12)
    @Field(type = FieldType.Keyword)
    private String createUser;

    @ApiModelProperty(value = "创建时间", position = 13)
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "更新人", position = 14)
    @Field(type = FieldType.Keyword)
    private String updateUser;

    @ApiModelProperty(value = "更新时间", position = 15)
    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}